using Marknic.TestRunner.Rigging;

namespace NetduinoHappyHour.Hardware
{
    class DriveCommandTests
    {
        public void TestSimpleConstruction()
        {
            DriveCommand dCommand = new DriveCommand();
            Assert.IsNotNull(dCommand);
        }

        public void TestComplexConstruction()
        {
            DriveCommand dCommand = new DriveCommand(5,5,10);
            Assert.IsNotNull(dCommand);
            Assert.AreEqual(5, dCommand.StepsToRunL);
            Assert.AreEqual(5, dCommand.StepsToRunR);
            Assert.IsTrue(dCommand.DirectionForwardL);
            Assert.IsTrue(dCommand.DirectionForwardR);
            dCommand = new DriveCommand(-5, -5, 10);
            Assert.IsFalse(dCommand.DirectionForwardL);
            Assert.IsFalse(dCommand.DirectionForwardR);
        }

        /// <summary>
        /// Test to check if steps are countet correctly.
        /// Can't name it TestExcute due to naming convention of testframework 
        /// this would assume an exception to be raised by prefix TestEx 
        /// </summary>
        public void TestDoExecute()
        {
            DriveCommand dCommand = new DriveCommand(5, 5, 10);
            dCommand.Execute();
            Assert.AreEqual(5, dCommand.StepsAlreadyRanL);
        }
    }
}
